<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" Content="text/html; charset=utf-8"/>

	<link rel="stylesheet" type="text/css" href="../css/header.css">
	<link rel="stylesheet" type="text/css" href="../css/footer.css">
	<link rel="stylesheet" type="text/css" href="../css/main.css">
	<link rel="stylesheet" href="../res/bootstrap/css/bootstrap.min.css">
	<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.js"></script>
	<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.js"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
	<script src="../myUtil.js"></script>

	<script type="text/javascript" src="../js/main.js"></script>
<script> 
    $(function(){
      $(".header").load("header.html");$(".footer").load("footer.html"); 
    });
    
    var myModule = angular.module('myModule', []);

    myModule.controller('MyController', function ($scope, $http,$location) {
        $scope.items = [];
        $scope.noticeitems=[];
        $scope.user={};
        
        
        $scope.loadData = function() {
        	myUtil.onHttp($http,'get','userAuthority.do',null,null,
        			function(data){
        				$scope.user = data;
        			}
        	)
        	myUtil.onHttp($http,'get','mainNotice.do',null,null,
        			function(data){
        				$scope.noticeitems = data;
        			}
        	)
        }
     	$scope.logout =function(){
     		location.href="logout.do";
     	}
     	$scope.go = function(content_id) {
        	location.href='notice_board.html#?content_id='+content_id+"&pg="+1+"&title="+0+"&subject="+''+"&search="+'';
       }
        $scope.loadData();
    });
</script> 

</head>
<body ng-app="myModule">
<div class="container" ng-controller="MyController">
<!-- header-->
<div class="header span12">
</div>

<!--main content-->

	<!--main IMG-->
	<div class="img span7""><img src="../res/img/mainImg.png"/></div>
	<!--//main IMG-->
		
	<!--Login-->
	<div class="login span4">
		<span><h1>LOGIN<i class="icon-check"></i></h1></span>
		<form class="logform" action="login_process.do" method="post" ng-if="user.id==null">
			<div class="row">
				<div class="span1">ID</div>
				<div class="span2"><input id="iden" type="text" name="j_username" placeholder="아이디를 입력하세요" /></div>
			</div>
			<div class="row">
				<div class="span1">PW</div>
				<div class="span2"><input id="password" type="password" name="j_password" placeholder="비밀번호를 입력하세요" /></div>
			</div>
			<div class="logbtn controls pull-right"><a class="btn" href="../03/password.jsp"><i class="icon-search"></i> PW 찾기</a><a class="btn" href="myedit.html"><i class="icon-user"></i> 회원가입</a><button  name="cmd" value="로그인" id="login" class="btn btn-primary"><i class="icon-ok icon-white"></i> 로그인</button>
				</div>
		</form>
		
		<div ng-if="user.id!=null">
			<div class="row">
				<div class="span1">권한</div>
				<div class="span2">{{user.authority}}</div>
			</div>
			<div class="row">
				<div class="span1">ID</div>
				<div class="span2">{{user.id}}</div>
			</div>
			
			<div class="logbtn controls pull-right">
			<button  ng-if="user.id!=null" ng-click="logout()" name="cmd" value="로그아웃" id="logout" class="btn btn-primary"><i class="icon-ok icon-white"></i> 로그아웃</button>
				</div>
		</div>
		
	</div>
	<!--//Login-->
	<!-- Tabs -->
	<div id="tabs">
		<ul>
			<li><a class="tab" href="#tabs-1">공지사항</a></li>
			<li><a class="tab" href="#tabs-2">대회일정</a></li>
			<li><a class="tab" href="#tabs-3">출품작</a></li>
		</ul>
		<div class ="select_tab span4">
			<div class="tab_on" id="tabs-1">
				<a ng-repeat="item in noticeitems" ng-click="go(item.content_id)" >{{item.title}}<br/></a>
			</div>
			<div class="tab_on" id="tabs-2">
				<table class="table table-hover">
				
					<thead>
						<tr>
							<td>구분</td>
							<td>대회명</td>
							<td>내용</td>
						</tr>
					<thead>
					<tbody><tr><td>접수</td><td>제1회 소프경진대회</td><td><a>link</a></td></tr><tbody>
		</table>
			</div>
			<div class="tab_on" id="tabs-3">
				<a></a>
			</div>
		</div>
	</div>
	<!--//tab-->
	<!--apply-->
	<div id="apply" class="span5">
		<h3>대회신청<i class="icon-ok-sign"></i></h3>
		<table class="table table-hover">
			<thead><tr><td>구분</td><td>대회명</td><td>접수신청일</td><td>접수마감일</td><td>신청</td></tr><thead>
			<tbody><tr><td>접수</td><td>제1회 소프경진대회</td><td>2014-08-11</td><td>2014-08-11</td><td><a>link</a></td></tr><tbody>
		</table>
	</div>
	
	<!--//apply-->

<!--//main content-->

<!--footer-->
	
	<div class="footer span12"></div>
<!--//footer-->
</div>
</body>
</html>